package com.lktx.auto.bean;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.ArrayList;
import java.util.List;

@Data
public class ChatMessage {

    private String model="deepseek-r1:7b";

    private List<Message> messages=new ArrayList<>();

    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    public static class Message{
        private String content;
        private String role;

        public Message(String content){
            this.content=content;
        }
    }

    public static ChatMessage newUserMessage(String message){
        ChatMessage chatMessage = new ChatMessage();
        chatMessage.messages.add(new Message(message,"user"));
        return chatMessage;
    }

    public void addUserMessage(String content){
        messages.add(new Message(content,"user"));
    }

    public void addAssistantMessage(String content){
        messages.add(new Message(content,"assistant"));
    }
}
